Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Java
Expertise: Advanced
Oct 24, 2006

Placing Multiple Headers in a DataTable

A DataTable can only handle one header for each column. The workaround for this is to use two tables. Generate the first table at the same time as the DataTable and the other one using HTML. The HTML table will contain the headers, however many you desire.

Next, align the columns from the two tables using CSS. For each column, create a class style and specify the width:

  background: none;
  width: 95px;
  text-align: left; 
This looks fine on all browsers.

Adrian Pascut
Thanks for your registration, follow us on our social networks to keep up-to-date