Jump to content

Search the Community

Showing results for tags 'html table'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 4 results

  1. I've created a table that works responsively across various screen sizes, with columns appearing and collapsing as desired to suit the different devices on which it can be loaded. One issue I'm having, however, regards the `colspan` element. There are instances in which I would like to have a column stretch across an entire row. A quick search of Github has found the following piece of jQuery: $(function() { jQuery.fn.exists = function(){return this.length>0;} // Dynamic Colspan if($('[colspan="auto"]').exists()) { $.each($('[colspan="auto"]'), function( index, value ) { var table = $(this).closest('table'); // Get Table var siblings = $(this).closest('tr').find('th:visible, td:visible').not('[colspan="auto"]').length; // Count colspan siblings var numCols = table.find('tr').first().find('th:visible, td:visible').length; // Count visible columns $(this).attr('colspan', numCols.toString()-siblings); // Update colspan attribute }); } }); Source: https://gist.github.com/afbora/6c98337a3455d45b6ae4e620d5cfbcf2 Here is an example of my table structure: <table> <thead> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </thead> <tbody> <tr> <td colspan="auto">Divider</td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> </table> As you can see, I have a row which makes use of `colspan="auto"` and works fantastically well with the jQuery source from above - automatically expanding to the full width of the row on page load. Where this breaks down, however, is in any instance where a `<td>` has been selected to be hidden in a responsive stylesheet. Instead of switching from `colspan="6"` to `colspan="5"` behind the scenes (DOM), we end up with one row where the colspan is too large. I've looked into `window.onresize`, as I believe the jQuery should run when the browser is made bigger or smaller, but am yet to have any success.
  2. Hi, bear with me I'm new to this and not too good at learning these days due to ms induced brain fog.... I've been using classic asp code from the tutorials to write a table with data from an access DB, I can get connected to the DB ok and can get all records into a table but can't seem to work out how to get the contents of several fields into the same table data box before going through the loop to write the next table box with the data fields from the next record, I just get a new box for each field, I'm sure it's something simple but I'm just not getting it. Do I need to open a new connection for each table field and how do they nest? I managed to get it to add table row tags every third entry which cheered me up. Thanks in advance for any help.
  3. Can someone please show code to lay 2 tables horizontally ? Thanks.
  4. This is my code that has 5 tables on a page. How do I prevent tables been shrinked? Only 1st table is readable on print preview.echo "<table width=\"70%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><div align=\"center\">Massage Therapy Technique(Written)</div></td>\n"; echo "<td><div align=\"center\">$grade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Massage Therapy Technique(pratical)</div></td>\n"; echo "<td><div align=\"center\">$mttp</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Anatomy,Physiology & Pathology</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Human Anatomy</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Human Pathology</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Human Physiology</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Kinesiology</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Business Practice and Professional Ethics</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Human Health & Hygiene / CPR / SFA</div></td>\n"; echo "<td><div align=\"center\">$grade</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Hydrotherapy</div></td>\n"; echo "<td><div align=\"center\">$avggrade</div></td></tr>\n"; echo "</table>\n";echo "<table width=\"60%\" height = \"20\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><div align=\"center\">Required Classroom Hours:</div></td>\n"; echo "<td><div align=\"center\">$rhrs</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Hours Attended to Date:</div></td>\n"; echo "<td><div align=\"center\">$ett</div></td></tr>\n"; echo "<tr><td><div align=\"center\">Make-up Hours Needed:</div></td>\n"; echo "<td><div align=\"center\">$ntt</div></td></tr>\n"; echo "</table>\n";echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><div align=\"left\">Probationary Action Taken:</div></td></tr>\n"; echo "<tr><td>______________________________________________________________</td></tr>\n"; echo "<tr><td>______________________________________________________________</td></tr>\n"; echo "<tr><td>______________________________________________________________</td></tr>\n"; echo "</table>\n";echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><div align=\"left\">General Comments:</div></td></tr>\n"; echo "<tr><td></td></tr>\n"; echo "<tr><td></td></tr>\n"; echo "<tr><td></td></tr>\n"; echo "</table>\n";echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><div align=\"left\">Student's Signature:</div></td>\n"; echo "<td><div align=\"left\">Instructor's Signature:</div></td></tr>\n"; echo "<tr><td></td><td></td></tr>\n"; echo "</table>\n"; echo '<div class="page"> </div>'."\n"
×
×
  • Create New...