3.0 beta 2

How to define the grid STYLE using PHP

Hi there,

I would like to change the style of my grid (Width and Length).
My code is thi one:

<title>ActiveWidgets Grid :: PHP Example</title>
body, html {margin:0px; padding: 0px; overflow: hidden;font: menu;border: none;}
#grid1 {height: 200px; width: 400px; border: 2px inset; background: white;}
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>

<!-- ActiveWidgets PHP functions -->
<?php include("activewidgets.php") ?>



// grid object name
$name = "obj";

// SQL query
$query = "select * from `TUsers` limit 0,20";

// database connection
$connection = mysql_connect("localhost", "root", "");

// query results
$data = mysql_query($query, $connection);

// add grid to the page
echo activewidgets_grid($name, $data);



It seams that the "#grid1 {height: 200px; width: 400px; border: 2px inset; background: white;}" is not working...

Any Idea

Hugo Abreu
September 12,
It looks like you are naming the grid 'obj' but your style is for grid 'grid1'. I think if you get your names in sync you will be fine.
Jim Hunter
September 12,
oops.. sorry..
this was an old version of the code. In my current version, the names are correct but still not working.

Thank you for your help, anyway.

Hugo Abreu
Hugo Abreu
September 12,
#grid1 {height: 200px...........
September 13,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.