Snippets Collections
Table =

{
	("Nik", 101),
	("Hafiz", 102),
}
Table =

DATATABLE(
	"SNo", INTEGER,
	"Name", STRING,
	{
		{101, "Nik"},
		{102, "Hafiz"},
	}
)
// MARK: - Table View

topPlayersTableView.delgate = self
topPlayersTableView.dataSource = self


extension HomeViewController : UITableViewDelegate, UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = topPlayersTableView.dequeueReusableCell(withIdentifier: "TopPlayerTableViewCell") as! TopPlayerTableViewCell
        return cell
    }
}
/* spacing */

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border: 3px solid purple;
}

thead th:nth-child(1) {
  width: 30%;
}

thead th:nth-child(2) {
  width: 20%;
}

thead th:nth-child(3) {
  width: 15%;
}

thead th:nth-child(4) {
  width: 35%;
}

th, td {
  padding: 20px;
}
<table>
  <caption>Caption describing what the table is about</caption>
  <thead>
    <tr>
      <th scope="col">Column 1 Heading </th>
      <th scope="col">Column 2 Heading</th>
      <th scope="col">Column 3 Heading</th>
      <th scope="col">Column 4 Heading</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Row 1 Heading</th>
      <td>Row 1 - Colummn 1 data</td>
      <td>Row 1-Column 2 Data</td>
      <td>Row 1 - Column 3 Data</td>
    </tr>
    <tr>
      <th scope="row">Row 2 Heading</th>
      <td>R2-C1 Data</td>
      <td>R2-C2 Data</td>
      <td>R2-C3 Data</td>
    </tr>

    <!-- several other great bands -->

    <tr>
      <th scope="row">Row 3 Heading</th>
      <td>R3-C1 Data</td>
      <td>R3-C2 Data</td>
      <td>R3-C3 Data</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th scope="row" colspan="2">Bottom Rows</th>
      <td colspan="2">77</td>
    </tr>
  </tfoot>
</table>
Table ... / nocellmerge misstext=' ';
import React from "react";
import PropTypes from "prop-types";

const Header = ({ title }) => {
  return (
    <header className="header">
      <h1>{title}</h1>
    </header>
  );
};

Header.propTypes = {
  title: PropTypes.string.isRequired,
};

export default Header;


///// ----- USING IT -------
import Header from "./components/Header";
<Header title="New Pixar Movies" />
import React from "react";
import PropTypes from "prop-types";

const Table = ({ tableData, headingColumns, title, breakOn = "medium", onItemClick, onHeadingClick, headingColumnFields }) => {
  let tableClass = "table-container__table";

  if (breakOn === "small") {
    tableClass += " table-container__table--break-sm";
  } else if (breakOn === "medium") {
    tableClass += " table-container__table--break-md";
  } else if (breakOn === "large") {
    tableClass += " table-container__table--break-lg";
  }

  const data = tableData.map((row, index) => {
    let rowData = [];
    let i = 0;

    for (const key in row) {
      rowData.push({
        key: headingColumns[i],
        val: row[key],
      });
      i++;
    }

    return (
      <tr key={index} onClick={()=>onItemClick(index)}>
        {rowData.map((data, index) => (
          <td key={index} data-heading={data.key}>
            {data.val}
          </td>
        ))}
      </tr>
    );
  });

  return (
    <div className="table-container">
      <div className="table-container__title">
        <h2>{title}</h2>
      </div>
      <table className={tableClass}>
        <thead>
          <tr>
            {headingColumns.map((col, index) => (
              <th key={index}  onClick={() => onHeadingClick(headingColumnFields[index])}>{col}</th>
            ))}
          </tr>
        </thead>
        <tbody>{data}</tbody>
      </table>
    </div>
  );
};

Table.propTypes = {
  tableData: PropTypes.arrayOf(PropTypes.object).isRequired,
  headingColumns: PropTypes.arrayOf(PropTypes.string).isRequired,
  title: PropTypes.string.isRequired,
  breakOn: PropTypes.oneOf(["small", "medium", "large"]),
  onItemClick: PropTypes.func.isRequired,
  onHeadingClick: PropTypes.func.isRequired,
  headingColumnFields: PropTypes.arrayOf(PropTypes.string).isRequired
};

export default Table;



// ------ USING THE TABLE -------
import Table from "./components/Table";
        {data ? (
          <Table
            tableData={data.results.sort(sortMovies).map((movie) => {
              return [
                data.title,
                new Date(data.release_date).toLocaleDateString(
                  undefined,
                  options
                ),
              ];
            })}
            headingColumns={["Title", "Release Date"]}
            title="Pixar Movies"
            breakOn="small"
            onItemClick={handleClick}
            onHeadingClick={handleSort}
            headingColumnFields={["title", "release_date"]}
          />
        ) : null}
star

Tue Dec 26 2023 03:29:11 GMT+0000 (Coordinated Universal Time)

#ms.pbi #dax #table
star

Tue Dec 26 2023 03:28:03 GMT+0000 (Coordinated Universal Time)

#ms.pbi #dax #dax.datatable #dax.integer #dax.string #table
star

Fri Jan 27 2023 17:21:38 GMT+0000 (Coordinated Universal Time)

#ios #swift #table #tableview #snippet
star

Tue Nov 08 2022 14:01:26 GMT+0000 (Coordinated Universal Time) https://database.guide/6-ways-to-check-if-a-table-exists-in-sql-server-t-sql-examples/

#table #exists
star

Sat Jul 16 2022 08:06:52 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Styling_tables

#tablestylecss #csstablestyle #table
star

Sat Jul 16 2022 08:04:05 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Styling_tables

#table #tablelayout #typical_html_table
star

Wed May 04 2022 23:27:04 GMT+0000 (Coordinated Universal Time)

#table #proctabulate
star

Thu Jul 29 2021 20:28:06 GMT+0000 (Coordinated Universal Time)

#javascript #react #table
star

Thu Jul 29 2021 20:26:18 GMT+0000 (Coordinated Universal Time)

#javascript #react #table

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension