Hi all,

I want to display a table (like the one below) in a block.

I am not getting how to create a view for the table below.

(I have taken content type as Personal Info with fields Name -> textfield, Age -> Numeric & Country -> textfield.)

+-----------+----------+------------+
| Name | Age | Country |
|------------------------------------|
| Raul | 26 | Italy | --> row in sky blue color
|------------------------------------|
| Adam | 31 | Russia | --> row in white color
+------------------------------------+

Please let me know, how this kind of view can be created ! I would be immensly happy, if you can provide with an example !

Thanks,
naresh.

Comments

drupal.naresh’s picture

Here Name, Age and Country are the column headers !

and the rest are the rows with alternate colors.

nevets’s picture

Are you using the views module, if yes this is pretty straight forward

Create a new view, give it a name

I recommend filling the information out under page, though not required it allows you do do a more link in the block.

Under 'Block' check 'Provide Block' and 'View Type' to 'Table view', fill in the rest of the block section as desired.

Under 'Fields' add the three fields you want for your table, the 'Label' value will be used for the column header.

Save the view

Under "Administer" -> "Site building" -> "Blocks" assign your new block to a region.

drupal.naresh’s picture

Hey nevet..

I got it. I don't understand, why i couldn't do it previously.. !

Anyway thanks a lot.

cheers,
- Naresh