i do not want to paste my html code in the body....
i want to create a table through code in .module file just like we create other fields e.g
$form['name']=array(
'#type' => 'textfield',
'#title' => t('Name '),
);
Read the instructions for theme_table().
Although it's better to learn from examples.
Unfortunately I can't think of any really simple examples... Try searching!
If you mean database table then you can access your database and insert the values inside the tables directly . Else there is a module for this purpose http://ftp.drupal.org/files/projects/dba-5.x-1.x-dev.tar.gz though it is underdeveloped .
if you are only trying to print the text, then remove echo from your code.
that way your string will simply get concatenated in the $output variable and it will get printed with the drupal_set_message.
Comments
Set your input format to
Set your input format to 'full html'
Turn off your WYSIWYG editor
Paste normal HTML syntax.
If you want to code PHP instead,
set your input format to 'PHP Code'
Turn off your WIYSIWG
Read the API docs on 'theme_table()'
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Use a HTML input filter
and then just use normal HTML syntax. Works fine for me.
Don't know if there is a BBCode euqivalent for this (and not sure you'd want one).
The alternative is to install a WYSIWYG editor with a table tool, but that's using the proverbial sledgehammer to crack the nut.
Gareth
table in .module file
i do not want to paste my html code in the body....
i want to create a table through code in .module file just like we create other fields e.g
$form['name']=array(
'#type' => 'textfield',
'#title' => t('Name '),
);
can anybody tell me the syntax for that?
see above
Read the instructions for theme_table().
Although it's better to learn from examples.
Unfortunately I can't think of any really simple examples... Try searching!
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
thanks
thank u ......i'l chk that out
table using 'item'
produces
Do you mean Database tables ?
If you mean database table then you can access your database and insert the values inside the tables directly . Else there is a module for this purpose http://ftp.drupal.org/files/projects/dba-5.x-1.x-dev.tar.gz though it is underdeveloped .
Thanks
not db table
i want to create a table to display some values in table format.
try table manager or Ajax Table
same as title
thank u
thank u all for ur reply
the problem is solved
Hi Vaishnavig I tried this
Hi Vaishnavig
I tried this code:
$output.=echo "
$output.=echo"
";
$output.=echo"
";
drupal_set_message($output);
but it showed parse error , what could be the reason?
thankyou
if
if you are only trying to print the text, then remove echo from your code.
that way your string will simply get concatenated in the $output variable and it will get printed with the drupal_set_message.
try this
use table theme
For this you should use table theme.
For detail you can read this
table theme api
I am giving you an example for this-
chetan