table style cells

Prev Next

Function Names

table style cells

Library

Style Library

Description

This function applies style and formatting to one or multiple cells inside the table. Attention: Formats added to cell locations which are outside of the table will not appear.

Call as: procedure

Restrictions

Don't forget to include 'Style Library' at the top of your program

Parameter count

6, 8, 10, etc.

Parameters

No.TypeDescription
1.
input
string Name fo existing table

2.
input
table columns Table columns to format

Specify 1 or more columns using header names and/or column numbers. Negative indexing is supported.

2.
input
set containing numerals
numeral
Row numbers

Specify 1 or more row numbers.
Hint: Use table selected rows() to identify row numbers using a condition to apply on every row.

4.
input
string Formatting Coverage

See formatting coverages. Valid values are:

  • single: Single cell addressed. If set provided, then both set must contain same number of elements. Each element pair corresponds to coordinates for one cell
  • matrix: Intersections of all specified rows and columns will be formatted
  • field: Pairs of 2 set elements represent a field to format.

5, 7, ...
input
string Generic Attribute Name

See generic attribute names for available names.

6, 8, ...
input
string Generic Attribute Value

See generic attribute values for valid values. Different rules apply for the different generic attribute names.

Examples

       table load( t, "Examples\Cities.csv" );

       table style cells( t, {City,City,Moving along},{1, 12, -2}, single, fill color, yellow );
       table style cells( t, {0,1}, {3,5}, single, fill color, lemon, font size, 20, font name, courier new );
       table style cells( t, {City,3,5}, {3,5,7,9}, matrix, fill color, green );
       table style cells( t, {Famous cultural place, Moving along}, {0,8}, field, fill color, cyan );

       table save( t, "Images/Style_Function_table_style_cells.html", HTML );
       table save( t, "Images/Style_Function_table_style_cells.xls", EXCEL );
       table save excel file( t, Contents, "Images/Style_Function_table_style_cells.xlsx" );
       echo("Done.");

Output

    Saved table(s) to EXCEL file 'Images/Style_Function_table_style_cells.xlsx' containing 1 sheets.

Done.
Try it yourself: Open LIB_Function_table_style_cells.b4p in B4P_Examples.zip. Decompress before use.

Viewing the Results:

Test Click on the file name view the result: Style_Function_table_style_cells.html.
Test Click on the file name open the file with Excel XML 2003: Style_Function_table_style_cells.xls (Excel XML 2003 format - confirm the message box query).
Test Click on the file name open the file with Excel (.xlsx) : Style_Function_table_style_cells.xlsx (Excel .xlsx format).

See also

table style table
table style rows
table style columns