Cannot display table with loads of attributes properly

Cannot display table with loads of attributes properly

bill_2016bill_2016 Posts: 1Questions: 1Answers: 0

Hi guys,

I am trying to create a table which has quite a lot of attributes, and as an example I created the following page,

<body>
  <table id="example">
    <thead>
      <tr>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
        <th class="site_name">Name</th>
        <th>Url </th><th>Type</th>
        <th>Last modified</th>
      </tr>
    </thead>
    <tbody>
    </tbody>
  </table>
  <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"></script>
  <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
  <script>
    $(function(){
      $("#example").dataTable({
                "scrollX": true
            });
    })
  </script>
</body>

I am expecting a scrollable table with all table headers in one line, but the result page is far from my expectation, as you can see from the attached image, some of the table headers are in two lines.

Can anyone give me some help, thanks in advance :smile:

This discussion has been closed.