Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide/Show Table Coulmns

Status
Not open for further replies.

Pattycake245

Programmer
Oct 31, 2003
497
CA
I've read dozens of posts on how to show and hide table rows, text fields, etc. What I could not find is if it is possible to show and hide a group of table columns. Would this even be possible?

Tim
 
Use the [tt]colgroup[/tt] and [tt]col[/tt] tags.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]

<html>
<head>
<title>Untitled</title>
</head>

<body>

<table>
<colgroup>
    <col id="c1" style="display: none;">
</colgroup>
<tr>
    <td>text 1</td>
    <td>text 2</td>
    <td>text 3</td>
</tr>
<tr>
    <td>text 1</td>
    <td>text 2</td>
    <td>text 3</td>
</tr>
<tr>
    <td>text 1</td>
    <td>text 2</td>
    <td>text 3</td>
</tr>
</table>

</body>
</html>

*cLFlaVA
----------------------------
[tt]your mom goes to college[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top